<?php 


$db = include ('./db.php');

if($_POST){

  $notice = true;
  $insertData = array();
  $insertData['username'] = $_POST['username'];
  $insertData['message'] = $_POST['message'];

  if(!empty($insertData['username'])&&!empty($insertData['message'])){
      array_push($db, $insertData);

      $insertData = var_export($db,TRUE);

  $str = <<<str
<?php 
return {$insertData} ?>
str;
  
      file_put_contents('./db.php', $str);
      $error = false;
  }else{
      $error = true;
  }

}


include "./template/index.html";




 ?>